package com.breakfast.fun.data.entity.user.dynamic;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/8/25.
 */
public class Dynamic {

    /**
     * total : 0
     * pageTotal : 0
     * data : {"isFollow":true,"dynamic":[{"id":970,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"又可以点明天的早餐啦","count":0,"praise":0,"addTime":"2016-08-24 16:39:20","image":"http://m.52letsgo.cn/user_image/7/0/2dc6c943-8_1218019931.jpg","address":""},{"id":950,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"2","count":0,"praise":0,"addTime":"2016-08-23 18:01:07","address":""},{"id":949,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"1","count":0,"praise":0,"addTime":"2016-08-23 18:00:01","address":""},{"id":946,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"为什么传不上去","count":0,"praise":0,"addTime":"2016-08-23 17:57:19","address":""},{"id":940,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"很好吃的花生燕麦粥哦","count":1,"praise":0,"addTime":"2016-08-23 09:22:17","address":""},{"id":927,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"荤素双搭，不错","count":1,"praise":1,"addTime":"2016-08-22 09:03:09","address":""}],"info":{"id":5407,"userName":"183****8629","userMobile":"","userPhoto":"http://m.52letsgo.cn","dynamicCount":6,"followCount":1,"fansCount":1,"inviteCount":2,"address":"福州市"}}
     * msg : 查询成功
     * success : true
     */

    private int total;
    private int pageTotal;
    /**
     * isFollow : true
     * dynamic : [{"id":970,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"又可以点明天的早餐啦","count":0,"praise":0,"addTime":"2016-08-24 16:39:20","image":"http://m.52letsgo.cn/user_image/7/0/2dc6c943-8_1218019931.jpg","address":""},{"id":950,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"2","count":0,"praise":0,"addTime":"2016-08-23 18:01:07","address":""},{"id":949,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"1","count":0,"praise":0,"addTime":"2016-08-23 18:00:01","address":""},{"id":946,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"为什么传不上去","count":0,"praise":0,"addTime":"2016-08-23 17:57:19","address":""},{"id":940,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"很好吃的花生燕麦粥哦","count":1,"praise":0,"addTime":"2016-08-23 09:22:17","address":""},{"id":927,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"荤素双搭，不错","count":1,"praise":1,"addTime":"2016-08-22 09:03:09","address":""}]
     * info : {"id":5407,"userName":"183****8629","userMobile":"","userPhoto":"http://m.52letsgo.cn","dynamicCount":6,"followCount":1,"fansCount":1,"inviteCount":2,"address":"福州市"}
     */

    private DynamicData data;
    private String msg;
    private boolean success;

    public static Dynamic objectFromData(String str) {

        return new Gson().fromJson(str, Dynamic.class);
    }

    public static List<Dynamic> arrayDynamicFromData(String str) {

        Type listType = new TypeToken<ArrayList<Dynamic>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getPageTotal() {
        return pageTotal;
    }

    public void setPageTotal(int pageTotal) {
        this.pageTotal = pageTotal;
    }

    public DynamicData getData() {
        return data;
    }

    public void setData(DynamicData data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }


}
